/**
 * @Package: 	com.group.JavaBean 
 * @author: 	Liu  
 * @date: 		Dec 26, 2018 11:35:18 AM 
 */
package com.group.JavaBean;

import java.util.ArrayList;
import java.util.List;

import com.group.DAO.GClassDAO;
import com.group.DAO.GStudentDAO;

/**
 * @ClassName:	 GClass.java
 * @Description: 班级类
 * @author:		 Liu
 * @date: 		 Dec 26, 2018 11:35:18 AM 
 */
public class GClass {
	// @Fields classID : 班级ID（6）
	String classID;
	// @Fields className : 班级名称
	String className;
	// @Fields classYear : 年级
	int classYear;
	// @Fields classNum : 班级总人数
	int classNum;
	public GClass() {};
	public GClass (String classID, String className, int classYear) {
		this.classID = classID;
		this.className = className;
		this.classYear = classYear;
	}
	
	/**
	 * @Function: 	 GClass.java
	 * @Description: 获得班级信息列表
	 * @param:		 
	 * @return:		 List<GClass>
	 * @author: 	 Liu
	 * @date:		 Dec 27, 2018 2:40:03 PM 
	 */
	public List<GClass> getGClassList(){
		List <GClass> class_list = new ArrayList<GClass>();
		GClassDAO dao = new GClassDAO();
		class_list = dao.getGClassList();
		return class_list;
	}
	
	/**
	 * @Function: 	 GClass.java
	 * @Description: 获取指定班级总人数
	 * @param:		   班级ID
	 * @return:		   班级总人数
	 * @author: 	 Liu
	 * @date:		 Dec 27, 2018 3:34:07 PM 
	 */
	public int getGClassNumByID(String classID) {
		GClassDAO dao = new GClassDAO();
		return dao.getGClassNumByID(classID);
	}
	
	/**
	 * @Function: 	 GClass.java
	 * @Description: 获取班级学生信息
	 * @param:		   班级ID
	 * @return:		   学生信息列表
	 * @author: 	 Liu
	 * @date:		 Dec 28, 2018 8:58:26 AM 
	 */
	public List<GStudent> getGStudentListByID(String classID, int pageNo, int pageSize){
		GClassDAO dao = new GClassDAO();
		return dao.getGStudentListByID(classID, pageNo, pageSize);
	}
	
	/**
	 * @Function: 	 GClass.java
	 * @Description: 更新班级信息
	 * @param:		   班级类
	 * @return:		 
	 * @author: 	 Liu
	 * @date:		 Dec 28, 2018 7:35:08 PM 
	 */
	public void updateGClassInfo(GClass gclass) {
		GClassDAO dao = new GClassDAO();
		dao.updateGClassInfo(gclass);
	}
	
	/**
	 * @Function: 	 GStudent.java
	 * @Description: 获取学生总数                         
	 * @param:		                                
	 * @return:		   学生总数                         
	 * @author: 	 Liu
	 * @date:		 Jan 2, 2019 7:18:12 PM 
	 */
	public int getRecordCountByID(String classID) {
		GClassDAO dao = new GClassDAO();
		return dao.getRecordCountByID(classID);
	}
	
	//get&set
	public String getClassID() {
		return classID;
	}
	public void setClassID(String classID) {
		this.classID = classID;
	}
	public String getClassName() {
		return className;
	}
	public void setClassName(String className) {
		this.className = className;
	}
	public int getClassYear() {
		return classYear;
	}
	public void setClassYear(int classYear) {
		this.classYear = classYear;
	}

	public int getClassNum() {
		return classNum;
	}
	public void setClassNum(int classNum) {
		this.classNum = classNum;
	}
	
}
